﻿namespace ClassLibrary.BusinessLayer.Facade
{
    using ClassLibrary.BusinessLayer.BusinessObjects;
    using ClassLibrary.DataLayer.DataObjects;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.Common;

    [DataObject(true)]
    public class CountriesFacade
    {
        private ICountriesDAO countriesDAO = DAOAccess.CountriesDAO;

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public bool AddCountries(Countries clsCountries)
        {
            return this.countriesDAO.InsertCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public int AddCountriesAndReturnIdentity(Countries clsCountries)
        {
            return this.countriesDAO.InsertCountriesReturnIdentity(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public string AddCountriesAndReturnOutput(Countries clsCountries)
        {
            return this.countriesDAO.InsertCountriesReturnOutput(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public bool DeleteCountries(Countries clsCountries)
        {
            return this.countriesDAO.DeleteCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Countries> GetCountries(Countries clsCountries)
        {
            return this.countriesDAO.GetCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Countries> GetCountries(string countries)
        {
            Countries clsCountries = new Countries();
            clsCountries._Country = countries;
            return this.countriesDAO.GetCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Countries> GetsCountries()
        {
            return this.countriesDAO.GetsCountries();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public DataTable GetsCountries(string SPName, DbParameter[] param)
        {
            return this.countriesDAO.GetsCountries(SPName, param);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Countries> ListCountries(Countries clsCountries)
        {
            return this.countriesDAO.ListCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Countries> ListCountries(string countries)
        {
            Countries clsCountries = new Countries();
            clsCountries._Country = countries;
            return this.countriesDAO.ListCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public bool UpdateCountries(Countries clsCountries)
        {
            return this.countriesDAO.UpdateCountries(clsCountries);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public int UpdateCountries(string SPName, DbParameter[] param)
        {
            return this.countriesDAO.UpdateCountries(SPName, param);
        }
    }
}

